<!--#INCLUDE FILE="conn.asp"-->
<!--#INCLUDE FILE="ad_function.asp"-->
<!-- #include file="aFunction_charCode.asp" -->
<!-- #include file="ad_comSub.asp" -->

<%
Call tslt_useridentity12_error_end()
%>

<HTML>
<HEAD>
<TITLE></TITLE>
<link href=../style/<%=session("tslt_stylefolder")%>/admin.css rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript">
            var timeout=2; 
            function isReload(){ 
                  if(timeout!=0){
                          timeout--;
                          //timeout++;
                   }else{
                          this.location.reload();
                   }
                  setTimeout("isReload()",1000)
             }
             function submitAndReload() {
                             form1.submit();
                             isReload();
             }  

             function set_onchange() { 
                   if (form1.act.selectedIndex == 3)
                   {
                            Reverse();
                            var ret;
                            var ret = confirm("ȷʵҪ̳ȫעûó֤Ա֤ԱԱԷ֤顣");
                            if(ret!=false)
                             {
                                    form1.button1.click();
                                    isReload();
                             }
                             else
                             {
                                    ReSet();
                                    document.form1.act.value="";
                             }
                    }  
                    if (form1.act.selectedIndex == 4)
                    {
                            Reverse();
                            var ret;
                            var ret = confirm("ȷʵҪȡȫעû֤Աʸ𣨹ԱͰֹܴ");
                            if(ret!=false)
                             {
                                    form1.button1.click();
                                    isReload();
                             }
                             else
                             {
                                    ReSet();
                                    document.form1.act.value="";
                             }
                            ReSet();
                    }
             }

             function Reverse(){ 
                    if(document.form1.chk_Id !=null)
                    {
                           var e = document.form1.chk_Id;
                          if(!e.checked)
                          {
                                 document.form1.chk_Id.checked = true;
                           }
                          var idList = document.form1;
                          for(var i=0;i<idList.chk_Id.length;i++)
                          {
                               var e = document.form1.chk_Id[i];
                               if(!e.checked)
                               {
                                     document.form1.chk_Id[i].checked = true;
                               }
                           }
                     }
             }

             function ReSet(){ 
                  if(document.form1.chk_Id !=null)
                  {
                       var idList = document.form1;
                       document.form1.chk_Id.checked = false;
                       var idList = document.form1;
                       for(var i=0;i<idList.chk_Id.length;i++)
                       {
                            document.form1.chk_Id[i].checked = false;
                       }
                  }
             }
</SCRIPT>

</HEAD>
<BODY bgcolor=#aaaac4>
<CENTER>
<br>
<table><tr><td class="font2">֤Ա</td></tr></table>
<hr width="700">
<br>

<%
If request.Form(AueUser)="ok" Then 
    Call isAueUser()
End If
%>

<table border=1 width=700 bgcolor=#dedfde cellpadding="5" cellspacing="15">
    <tr>
        <td align=center>
            <FORM name="form1" METHOD=POST ACTION="aueUser.asp?page=<%=Request.QueryString("page")%>">
            <INPUT TYPE="hidden" NAME="AueUser" value="ok">
            <table border="0" width="100%" cellspacing="1" cellpadding="0" >
               <tr>
			        <td  class=td align="center" height="15" width="23%"><font color="#FF0000">û</font></td>
			        <td  class=td align="center" height="15" width="10%"><font color="#FF0000">֤Ա</font></td>
			        <td  class=td align="center" height="15" width="10%"><font color="#FF0000"></font></td>
                    <td  class=td align="center" height="15" width="10%"><font color="#FF0000">ظ</font></td>
                    <td  class=td align="center" height="15" width="10%"><font color="#FF0000"></font></td>
                    <td  class=td align="center" height="15" width="10%"><font color="#FF0000"></font></td>
	           </tr>
<%
               Dim objRS,strSQL
               Dim keyword2
               If request("keyword")<>"" Then   
	               keyword2=trim(request("keyword"))
                   sel1=request("sel1")
                   If sel1="֤Ա" Then 
                       Call bclass123()
                       strSQL = "SELECT * FROM ts_userinfo where aueUser=true Order By id DESc"
                   Else 
                       strSQL = "SELECT * FROM ts_userinfo where (username like '%"& keyword2 &"%') Order By id DESc"
                   End If 
	           Else
                   strSQL = "SELECT * FROM ts_userinfo Order By id DESc"
               End If 
               Set objRS = Server.CreateObject("ADODB.Recordset")
               objRS.Open strSQL, Conn, 1, 2
               If objRS.Eof And objRS.Bof Then
                    If request("keyword")<>"" Then
                        Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_aueUser(0))</SCRIPT>"
                        Response.write"<META HTTP-EQUIV='Refresh' content='3; URL=" &Request.ServerVariables("HTTP_REFERER")& "'>"
                    Else                                      
                        Response.write"<SCRIPT language=Javascript>passwords(promptInfo_aueUser(1))</SCRIPT>"
                        Response.write"<META HTTP-EQUIV='Refresh' content='3; URL=" &Request.ServerVariables("HTTP_REFERER")& "'>"
                    End If 
			    Else
                    Dim totalPage,totalRecordcount
                    objrs.PageSize = showlistok()
                    ' RowCount=objrs.PageSize
                    totalPage=objrs.pagecount
                    objRS.AbsolutePage=REQUEST("Page")
                    totalRecordcount = objrs.recordcount 
                    If Request("Page") <> "" Then   
                        ShowPage objRS, Request("Page") 							
                    Else  
                        ShowPage objRS, 1  
                    End If  
                End If
%>
            </TABLE>

            <TABLE width="100%" border="0">
                <TR><TD>
			            <div align="right">
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <select name=act class=input2 LANGUAGE=javascript onchange="return set_onchange();">
                            <option value="0"></option>
                            <option value="1">֤Ա</option>
                            <option value="2">ȡ֤</option>        
                            <option value="3">ȫ֤</option>
                            <option value="4">ȡȫ֤</option>
                        </select>
                        <input class="input3" type="button" name="button1" value="ȷ" LANGUAGE=javascript onclick="return submitAndReload();">
                        </div>
              </TD></TR>
            </TABLE>
            </FORM>
             <TABLE width="100%" border="1" style="background-color:#ffffff">
                <TR><TD>
                           <%call pages()%>
                 </TD></TR>
             </TABLE>
        </td>
    </tr>
</table>

<%
objRS.Close
Set objRS = Nothing

Call conn_Nothing()
%>

<br>
<form name=search action=aueUser.asp method=post>
<table width=570 height=35 border=1 cellspacing=0 cellpadding=2 align=center>                   
       <tr bordercolor=#0099CC align=center> 
           <td bgcolor=LightBlue align=right  width=25%><span style="font-size:20;color:#000070">û:</span></td>
           <td bgcolor=LightBlue width="25%"> <input type=text size=17 name=keyword maxlength=50 value=<%=keyword2%>></td>
           <td bgcolor=LightBlue align=left width="24%">
				<SELECT name=sel1>
		               <OPTION></OPTION>
		               <OPTION>֤Ա</OPTION>
                </SELECT>
                <input type=submit height=18 width=39 name=b2 value=></td>
           <td>&nbsp;<a href=javascript:history.go(-1)>ǰҳ</a></td>
       </tr>
</table>
</form>

<SCRIPT for=sel1 event=onclick language="JavaScript">
        if (this.selectedIndex==1)
        {
            keyword.value=this.options(this.selectedIndex).text;
        }
</SCRIPT>

</CENTER>
</BODY>
</HTML>

<%
Sub isAueUser()
    Dim Rs
    Set RS=Server.CreateObject("ADODB.RecordSet")
    SQL="Select * From ts_userinfo"
    RS.open SQL,Conn,1,2 
       select case request("act")
            case 1
                 Do while not RS.eof
                     n=trim(cstr(RS("id")))
                     If request.form(n)="on" Then
                         conn.Execute ("update ts_userinfo set aueUser=true where id="&RS("id"))
                     End If 
                     RS.movenext
                 Loop
				 Call info()
            case 2
                 Do while not RS.eof
                     n=trim(cstr(RS("id")))
                     If request.form(n)="on" Then
                         If RS("bclass")<>"1" And RS("bclass")<>"2" And RS("bclass")<>"3" Then
                             conn.Execute ("update ts_userinfo set aueUser=false where id="&RS("id"))
                         End If 
                     End If 
                     RS.movenext
                 Loop
				 Call info()
            Case 3
                 conn.Execute ("update ts_userinfo set aueUser=true")
                 Call info()
		    Case 4
                 Do while not RS.eof
                     If RS("bclass")<>"1" And RS("bclass")<>"2" And RS("bclass")<>"3" Then
                         conn.Execute ("update ts_userinfo set aueUser=false where id="&RS("id"))
                     End If 
                     RS.movenext
                 Loop   
				 Call info()
        End Select
    RS.Close
    Set RS = Nothing
End Sub 
 
Sub info()
    Response.write"<SCRIPT language=Javascript>passwords(promptInfo_aueUser(2))</SCRIPT>"
End Sub 

sub pages()
        dim Page      
        Page = Request("Page")
        if Page="" or Page=0 then
                 page=1
        else
                 page=cint(request("page"))
        end if
       if totalRecordcount<>0 then
            dim currid1,currid2
            if totalPage>=10 then
                  if Page mod 10=0 then
                        currid1=Page
                        currid2=Page-9
                  else
                        if totalPage mod 10=0 then 
                               currid1=int(Page/10)*10+10
                        else 
                               if int(Page/10)=int(totalPage/10) then currid1=(totalPage/10)*10 else currid1=int(Page/10)*10+10
                        end if
                        currid2=int(Page/10)*10+1
                  end if
            else 
                  currid1=totalPage mod 10
                  currid2=int(totalPage/10)*10+1
            end if
%>
            <table align=left>
                 <tr><td>
<%
                        if totalPage>1 Then
                              If Page=totalPage or Page<>1 Then 
                                     dim PrwePage
                                     PrwePage=Page-1
                                     Response.Write "<A class=a1 HREF=aueUser.asp?Page="&PrwePage&"&keyword="&keyword2&"&sel1="&request("sel1")   
                                     Response.Write "><font size=4>һҳ</font></A>  "              
                              End If  
                        End If          
%>
                 </td></tr>
            </table>
            <table border="0" align="left">
                 <tr><td>
                       <FONT face=webdings size=2>
                       <%if Page=1 then%>
                               <span style="color: #FF0000">9</span>
                       <%else%>
                               <a class=a2 href="aueUser.asp?Page=1<%="&keyword="&keyword2&"&sel1="&request("sel1")%>">9</a>
                       <%end if%>
                       <%if Page>10 then%>
                               <a class=a2 href="aueUser.asp?Page=<%=currid2-1&"&keyword="&keyword2&"&sel1="&request("sel1")%>">7</a>
                       <%end if%>
                       </FONT>
                       <strong>
<%
                       for i=currid2 to currid1
                            if Page=i then 
	                             response.Write("<font color=red size=4>"&i&"</font>  ")
                            else
%>
                                 <FONT size=2>
                                 <a class=a2 href="aueUser.asp?Page=<%=i&"&keyword="&keyword2&"&sel1="&request("sel1")%>">
                                        <%response.write i%>
                                 </a>
                                 </FONT>
                            <%end if%>
                            <%response.write " "%>
                       <%next%>
                       </strong>
                       <FONT face=webdings size=2>
                       <%if currid1<totalPage then%>
                             <a class=a2 href="aueUser.asp?Page=<%=currid1+1&"&keyword="&keyword2&"&sel1="&request("sel1")%>">8</a>
                      <%end if%>
                      </FONT> 
                      <FONT face=webdings size=2>
                      <%if Page=totalPage then%>
                             <span style="color: #FF0000">:</span>
                      <%else%>
                             <a class=a2 href="aueUser.asp?Page=<%=totalPage&"&keyword="&keyword2&"&sel1="&request("sel1")%>">:</a>
                      <%end if%>
                      </FONT>
                 </td></tr>
            </table>
            <table align=left>
                 <tr><td>
<% 
                        if totalPage>1 Then
                             If page=1 or totalPage>Page Then
                                   dim NextPage
                                   NextPage=Page+1
                                   Response.Write "<A  class=a1 HREF=aueUser.asp?Page="&NextPage&"&keyword="&keyword2&"&sel1="&request("sel1")
                                   Response.Write "><font size=4>һҳ</font></A>"
                             End If
                        End If
%>
                 </td></tr>
            </table>
            <table align=right>
                 <tr><td>
<%
                       if Page>totalPage then
                            Page=totalPage
                       end if
                      Response.Write "<font size=2>ҳΣ<font color= red><b>"& Page &"</b></font>/<b>"& totalPage &"</b>ҳ ,<b>"& totalRecordcount &"</b></font>"
%>
                </td></tr>
            </table>
<%
        end if
end Sub

Sub ShowPage(objRS, Page)
       objRS.AbsolutePage = Page 
       For I = 1 To objRS.PageSize
              Response.Write "<TR height='20'>"
              Response.Write "<td class=td1 align='center'><font size=2>"
              call userStanding(objrs("username"))
              call UserInfoLink(objrs("username")) 
              Response.Write "</td>" 
%>
              <%If objRS("aueUser")=True Then%>
                    <td class=td1 align='center'><INPUT TYPE='checkbox' style="background-color:red;" <%If objRS("aueUser")=True Then%>checked<%End If%> disabled NAME=''></td>
              <%Else%>
                    <td class=td1 align='center'><INPUT TYPE='checkbox' <%If objRS("aueUser")=True Then%>checked<%End If%> disabled NAME=''></td>
              <%End If %>
<%			  
              Response.Write "<td class=td1 align='center'><font size=2>" & objRS("articleTotal") & "</td>"
              Response.Write "<td class=td1 align='center'><font size=2>" & objRS("replyTotal") & "</td>"
              Response.Write "<td class=td1 align='center'><font size=2>" & objRS("UserIntegral") & "</td>"
%>
			  <td class=td1 align=center><INPUT TYPE="checkbox" NAME=<%=objRS("id")%> id="chk_Id" value="on"></td>
<%
			  Response.Write "</TR>"
              Response.Write "<TR height='6' bgcolor='#fffff8'><td colspan='6'></TR>"
              objRS.MoveNext
              If objRS.EOF Then Exit For
       Next    
End Sub

Sub bclass123()    
    Dim rs,sql 
    sql = "SELECT id,bclass FROM ts_userinfo"
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sql, Conn, 1, 2
	   Do While Not rs.eof 
           If rs("bclass")=1 Or rs("bclass")=2 Or rs("bclass")=3 Then
               conn.execute("update ts_userinfo set aueUser=true where id="&RS("id"))
		   End If 
	   rs.movenext
	   Loop 
	rs.close
	Set rs=Nothing 
End Sub 


%>

